package com.acwing.partition18;

import java.io.*;

/**
 * @author `RKC`
 * @date 2022/2/3 18:53
 */
public class AC1762牛的洗牌 {

    private static final int N = 110;
    private static int[] seq = new int[N], start = new int[N], end = new int[N];
    private static int n = 0;

    private static final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    private static final BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        n = Integer.parseInt(reader.readLine());
        String[] ss = reader.readLine().split(" ");
        //逆向记录洗牌位置
        for (int i = 1; i <= n; i++) {
            int j = Integer.parseInt(ss[i - 1]);
            seq[j] = i;
        }
        ss = reader.readLine().split(" ");
        for (int i = 1; i <= n; i++) start[i] = Integer.parseInt(ss[i - 1]);
        for (int i = 1; i <= n; i++) end[seq[seq[seq[i]]]] = start[i];
        for (int i = 1; i <= n; i++) writer.write(end[i] + "\n");
        writer.flush();
    }
}
